package cn.itsy.dao;

import cn.itsy.pojo.*;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class LituixiuDaoImpl implements LituixiuDao {
    @Resource
    protected JdbcTemplate jt;

    @Override
    public List<Emp> emplist(String sql) {
        List<Emp> empList = jt.query(sql, new BeanPropertyRowMapper<Emp>(Emp.class));
        return empList;
    }

    @Override
    public List<LIzhi> queryEmp(String sql) {
        List<LIzhi> query = jt.query(sql, new BeanPropertyRowMapper<LIzhi>(LIzhi.class));
        return query;
    }

    @Override
    public List<Dept> queryDept(String sql1) {
        List<Dept> depts = jt.query(sql1, new BeanPropertyRowMapper<Dept>(Dept.class));
        return depts;
    }

    @Override
    public List<Job> JobAll(String sql) {
        List<Job> query = jt.query(sql, new BeanPropertyRowMapper<Job>(Job.class));
        return query;
    }

    @Override
    public List<Duct> ducts(String sql) {

        List<Duct> ducts = jt.query(sql, new BeanPropertyRowMapper<Duct>(Duct.class));
        return ducts;
    }


    @Override
    public void updateEmp(String sql) {
        jt.update(sql);
    }

}

